package org.qiyu.live.bank.provider.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import jakarta.annotation.Resource;
import org.qiyu.live.bank.provider.dao.mapper.IPayTopicMapper;
import org.qiyu.live.bank.provider.dao.po.PayTopicPO;
import org.qiyu.live.bank.provider.service.IPayTopicService;
import org.qiyu.live.common.interfaces.enums.CommonStatusEnum;
import org.springframework.stereotype.Service;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: sfx
 * Date: 2023-11-07
 * Time: 17:20
 */
@Service
public class PayTopicServiceImpl implements IPayTopicService {

    @Resource
    private IPayTopicMapper payTopicMapper;

    @Override
    public String getTopicByBizCode(Integer BizCode) {
        LambdaQueryWrapper<PayTopicPO> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(PayTopicPO::getBizCode, BizCode);
        queryWrapper.eq(PayTopicPO::getStatus, CommonStatusEnum.VALID.getCode());
        PayTopicPO payTopicPO = payTopicMapper.selectOne(queryWrapper);
        return payTopicPO.getTopic();
    }
}
